package com.aaa.three.controller;


import com.aaa.three.aop.Log;
import com.aaa.three.pojo.domain.NewsColumn;
import com.aaa.three.pojo.query.NewsColumnQuery;
import com.aaa.three.pojo.vo.NewsColumnVO;
import com.aaa.three.result.AjaxResult;
import com.aaa.three.service.NewsColumnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @Author: whf
 * @Date: 2022/2/14 19:49
 */
@RestController
@RequestMapping("column")
public class NewsColumnController {

    @Autowired
    private NewsColumnService newsColumnService;

    @RequestMapping("listColumn")
    public AjaxResult listColumn(NewsColumnQuery newsColumnQuery) {
        return newsColumnService.listColumn(newsColumnQuery);
    }

    @RequestMapping("addColumn")
    @Log("添加新闻栏目")
    public AjaxResult addColumn(NewsColumnVO newsColumnVO) {
        return newsColumnService.addColumn(newsColumnVO);
    }

    @RequestMapping("deleteColumn/{id}")
    @Log("删除新闻栏目")
    public AjaxResult deleteColumn(@PathVariable("id") Integer id) {
        return newsColumnService.deleteColumn(id);
    }

    @RequestMapping("getColumn/{id}")
    public AjaxResult getColumn(@PathVariable("id") Integer id) {
        return newsColumnService.getColumn(id);
    }

    @RequestMapping("updateColumn")
    @Log("修改新闻栏目")
    public AjaxResult updateColumn(NewsColumnVO newsColumnVO) {
        return newsColumnService.updateColumn(newsColumnVO);
    }

    @RequestMapping("newsListNewsColumn")
    public AjaxResult newsListNewsColumn() {
        return newsColumnService.newsListNewsColumn();
    }

}
